﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace ezCloud.SendEmailMarketingBySchedule.Core
{
    public class SystemConfiguration
    {
        private static string directionEmailTemplate;
        public static string DIRECTION_EMAIL_TEMPLATE
        {
            get
            {
                if (!string.IsNullOrWhiteSpace(directionEmailTemplate)) return directionEmailTemplate;
                var key = ConfigurationManager.AppSettings.AllKeys.FirstOrDefault(x => x.ToUpper() == "DIRECTION_EMAIL_TEMPLATE");
                if (!string.IsNullOrEmpty(key)) directionEmailTemplate = @"" + ConfigurationManager.AppSettings[key];
                if (string.IsNullOrWhiteSpace(directionEmailTemplate)) return @"D:\EmailMarketing\TemplateEmail";
                directionEmailTemplate = directionEmailTemplate.ToUpper();
                return directionEmailTemplate;
            }
        }
    }
}